1. Field of the Invention
The present invention relates to a method and a related apparatus for controlling transmission interface between an external device and a computer system, and more particularly, to a method and a related apparatus which embeds transmission interface data in a device configuration data of the external device.
2. Description of the Prior Art
With advanced development of computer technology, the size of a computer system is gradually being reduced. The computer system is now used in a broad spectrum of fields. In order to expand additional functions of the computer system to meet requirements of different users, many kinds of external devices are invented under this situation. For example, an external hard disk drive or other portable data storage devices can increase the total data storage capacity of the computer system. An external optical drive and an external optical recordable drive can provide the computer system with an additional ability of accessing multimedia data recorded on compact disks and storing a great quantity of back-up data on the compact disk. In addition, an IC smart card and an external network card can individually provide other functions to make the computer system become a more powerful tool for users.
If the external devices are designed to expand functions of the computer system, the external devices must be able to communicate with the computer system for transferring data. Please refer to FIG. 1, which is a block diagram of a standard computer system 10 connected to prior art external devices 20A, 20B. The computer system 10 has a host 11 which comprises a central processing unit (CPU) 12A, a north bridge circuit 12B and a south bridge circuit 12C, a video graphics array (VGA) card 12D, a monitor 12E, a memory 12F, a soundcard 14A, a speaker 14D, an input device 14B, a hard disk drive 14C, and a connecting port 14E.
The computer system 10 usually has a plurality of external devices connected to the same host 11. The connecting port 14E, therefore, has a plurality of first connecting terminals. For clarity, there are only two first connecting terminals 16A, 16B shown in FIG. 1. Each of the first connecting terminals 16A, 16B corresponds to an external device. As shown in FIG. 1, the first external device 20A is connected to the host 11 through the first connecting terminal 16A, and the second external device 20B is connected to the host 11 through the second connecting terminal 16B. Taking the first external device 20A as an example, the structure and operation of the prior art external device is further described as follows. The first external device 20A has a second connecting terminal 18A corresponding to the first connecting terminal 16A. Furthermore, the first external device 20A has a transmission interface controller 22, a driver circuit 24B, a non-volatile memory 26B, and a kernel module 29. The transmission interface controller 22 has a bridge circuit 24A and a non-volatile memory 26A. The kernel module 29 is used for actually performing a predetermined function of the first external device 20A. For example, if the first external device 20A is an external hard disk drive, the kernel module 29 is the physical storage disk used for recording data. If the first external device 20A is an external optical drive, the kernel module 29 comprises a pick-up head and a motor for rotating the disk, etc. Similarly, if the first external device 20A is an external memory card, the kernel module 29 is a flash memory. The driver circuit 24B is used for controlling operation of the kernel module 29. The memory 26B electrically connected to the driver circuit 24B is used for storing device configuration data 28B of the first external device 20A, that is, the configuration information associated with the kernel module 29. For example, if the first external device 20A is an optical drive, the device configuration data 28B comprises information about direct memory access (DMA). If the first external device 20A is an external hard disk drive, the device configuration data 28B comprises information about parameters such as capacity, cylinders, and sectors. The host 11 must obtain the device configuration data 28B to control external devices 16A, 16B through the transmission interface controller 22.
In order to make different kinds of external devices suitable for the host 11, a plurality of connecting port standards are defined to meet different requirements. However, different specifications are not compatible with each other. The host 11 may adopt a universal serial bus (USB) specification (first format), but the external devices 16A, 16B may adopt another connecting port specification (second format). If the first external device 20A is an external hard disk drive, the first external device 20A requires commands compatible with an AT attachment (ATA) specification to control the driver circuit 24B. Similarly, if the first external device 20A is an external optical drive, the first external device 20A requires commands compatible with an ATA packet interface (ATAPI) specification to control the driver circuit 24B. Data compatible with the first format have a different structure and a different electronic character compared with the data compatible with the second format. The bridge circuit 24A, therefore, is necessary to convert data transmitted between the connecting port 14E and the driver circuit 24B. The bridge circuit 24A has a first port 25A for receiving and outputting data compatible with the first format and a second port 25B for receiving and outputting data compatible with the second format. The bridge circuit 24A can transform the data compatible with the first format (USB for example) into data compatible with the second format (ATA or ATAPI for example). That is, when the host 11 wants to control the first external device 20A, the host 11 will output commands compatible with the first format (signal S1 shown in FIG. 1) through the connecting port 14E to the first external device 20A. The bridge circuit 24A of the first external device 20A will analyze the signal S1 to retrieve the original commands, and transmits the commands compatible with the second format (signal S2 shown in FIG. 1) from the second port 25B to the driver circuit 24B. The driver circuit 24B then can control the kernel module 29 to perform some actions such as retrieving data according to the commands generated from the host 11. On the other hand, the data transferred from the kernel module 29 and the driver circuit 24B to the host 11 will first be transmitted to the second port 25B of the bridge circuit 24A according to the second format, and the bridge circuit 24A then transforms the received data into data compatible with the first format. Finally, the data compatible with the first format are outputted from the first port 25A and are passed through the second connecting port 18A and the first connecting port 16A to arrive at the connecting port 14E. The host 11, therefore, can now conveniently exchange data with the external devices 20A, 20B through the transmission interface controller 22.
In addition to the above-mentioned signal format transformation, the transmission interface controller 22 further uses a non-volatile memory 26A to store the transmission interface data 28A. The transmission interface data 28A comprises unique identification data associated with the bridge circuit 24 such as a vendor identity code, a product identity code, manufacturer information, a serial number code, and so forth. As mentioned above, the many external devices nowadays can simultaneously attach to only one computer host, and the specific transmission interface data of each external device are used for identifying individual external devices so that the host can control those external devices through the connecting port. In other words, when the host wants to transmit a command to a specific external device, the host can assign unique transmission interface data associated with the desired external device at the same time so that the command will only be received by the external device compatible with the assigned transmission interface data.
To sum up, when the host 11 starts operating (power-on), the host 11 will search any external devices connected to the connecting port 14E. If there are external devices connected to the connecting port 14E (the first external devices 20A, 20B shown in FIG. 1), the host 11 will ask every first external device 20A, 20B to hand over corresponding transmission interface data to the host 11. Taking the prior art first external device 20A as an example, when the bridge circuit 24A receives the request from the host 11, the bridge circuit 24A will retrieve the transmission interface data 28A from the memory 26A and transmit the transmission interface data 28A to the host 11. After the host 11 receives the transmission interface data of each external device, the host 11 can exchange data with the external devices by assigning specific transmission interface data to select a corresponding external device. If the host 11 wants to control operation of the external devices, the host 11 will require the device configuration data of each external device. Taking the first external device 20A as an example again, when the bridge circuit 24A receives the request from the host 11, the bridge circuit 24A will transmit an “identify driver” command compatible with the second format (ATA or ATAPI) to the driver circuit 24B, and the driver circuit 24B will retrieve and transmit the device configuration data 28B to the bridge circuit 24A. Then, the bridge circuit 24A transmits the device configuration data 28B compatible with the first format to the host 11. After the host 11 gets the device configuration data 28B, the host 11 can control operation of the external device with adequate parameters and commands according to the device configuration data 28B.
The principal drawback mentioned above is that the driver circuit 24B and the transmission interface controller 22 respectively need memory 26B, 26A to store device configuration data 28B and the transmission interface data 28A. The device configuration data 28B are related to parameters required by the operation of the first external device 20A, and the transmission interface data 28A are related to control of the transmission interface between the host 11 and the first external device 20A. Both data must be stored in non-volatile memory. The prior art computer system uses two non-volatile memory 26A, 26B to store the device configuration data 28B and the transmission interface data 28A respectively. The non-volatile memory such as an electrically erasable programmable read-only memory (EEPROM) or a flash memory has a special structure compared with an ordinary logic circuit, and requires a special circuit design to work properly. Therefore, the production cost is high. In other words, the prior art transmission interface controller of the external device has a high production cost and a complicated circuit design.